import * as ApiUtil from '@/api/index';

const api = {
  jobList: ApiUtil.getI5xforyouUrl('/i5xforyou/backend/jobs/list'),
  jobShardingList: ApiUtil.getI5xforyouUrl('/i5xforyou/backend/jobs/shardingList'),
  triggerJob: ApiUtil.getI5xforyouUrl('/i5xforyou/backend/jobs/trigger'),
  enableJob: ApiUtil.getI5xforyouUrl('/i5xforyou/backend/jobs/enable'),
  disableJob: ApiUtil.getI5xforyouUrl('/i5xforyou/backend/jobs/disable'),
  shutdownJob: ApiUtil.getI5xforyouUrl('/i5xforyou/backend/jobs/shutdown'),
  removeJob: ApiUtil.getI5xforyouUrl('/i5xforyou/backend/jobs/remove'),
  jobExecutionLogList: ApiUtil.getI5xforyouUrl('/i5xforyou/backend/jobs/executionLogList'),
};

export function jobList() {
  return ApiUtil.getI5xforyou(api.jobList);
}

export function jobShardingList(data?: object) {
  return ApiUtil.getI5xforyou(api.jobShardingList, data);
}

export function triggerJob(data?: object) {
  return ApiUtil.getI5xforyou(api.triggerJob, data);
}

export function enableJob(data?: object) {
  return ApiUtil.getI5xforyou(api.enableJob, data);
}

export function disableJob(data?: object) {
  return ApiUtil.getI5xforyou(api.disableJob, data);
}

export function shutdownJob(data?: object) {
  return ApiUtil.getI5xforyou(api.shutdownJob, data);
}

export function removeJob(data?: object) {
  return ApiUtil.getI5xforyou(api.removeJob, data);
}

export function jobExecutionLogList(data?: object) {
  return ApiUtil.getI5xforyou(api.jobExecutionLogList, data);
}
